package com.ruoyi.mng.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.mng.mapper.HzChaChannelMapper;
import com.ruoyi.mng.domain.HzChaChannel;
import com.ruoyi.mng.service.IHzChaChannelService;
import com.ruoyi.common.core.text.Convert;

/**
 * 渠道管理Service业务层处理
 * 
 * @author chenqiang
 * @date 2023-04-28
 */
@Service
public class HzChaChannelServiceImpl implements IHzChaChannelService 
{
    @Autowired
    private HzChaChannelMapper hzChaChannelMapper;

    /**
     * 查询渠道管理
     * 
     * @param channelId 渠道管理主键
     * @return 渠道管理
     */
    @Override
    public HzChaChannel selectHzChaChannelByChannelId(Long channelId)
    {
        return hzChaChannelMapper.selectHzChaChannelByChannelId(channelId);
    }

    /**
     * 查询渠道管理列表
     * 
     * @param hzChaChannel 渠道管理
     * @return 渠道管理
     */
    @Override
    public List<HzChaChannel> selectHzChaChannelList(HzChaChannel hzChaChannel)
    {
        return hzChaChannelMapper.selectHzChaChannelList(hzChaChannel);
    }

    /**
     * 新增渠道管理
     * 
     * @param hzChaChannel 渠道管理
     * @return 结果
     */
    @Override
    public int insertHzChaChannel(HzChaChannel hzChaChannel)
    {
        hzChaChannel.setCreateTime(DateUtils.getNowDate());
        hzChaChannel.setUpdateTime(DateUtils.getNowDate());
        return hzChaChannelMapper.insertHzChaChannel(hzChaChannel);
    }

    /**
     * 修改渠道管理
     * 
     * @param hzChaChannel 渠道管理
     * @return 结果
     */
    @Override
    public int updateHzChaChannel(HzChaChannel hzChaChannel)
    {
        hzChaChannel.setUpdateTime(DateUtils.getNowDate());
        return hzChaChannelMapper.updateHzChaChannel(hzChaChannel);
    }

    /**
     * 批量删除渠道管理
     * 
     * @param channelIds 需要删除的渠道管理主键
     * @return 结果
     */
    @Override
    public int deleteHzChaChannelByChannelIds(String channelIds)
    {
        return hzChaChannelMapper.deleteHzChaChannelByChannelIds(Convert.toStrArray(channelIds));
    }

    /**
     * 删除渠道管理信息
     * 
     * @param channelId 渠道管理主键
     * @return 结果
     */
    @Override
    public int deleteHzChaChannelByChannelId(Long channelId)
    {
        return hzChaChannelMapper.deleteHzChaChannelByChannelId(channelId);
    }
}
